﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Lesson01
{
    public partial class ValidationGroupExample : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Unnamed3_Click(object sender, EventArgs e)
        {
            if (this.IsPostBack)
            {
                if (this.Page.IsValid)
                    this.lblStatus.Text = (sender as Button).ValidationGroup + " is valid";
                else
                    this.lblStatus.Text = (sender as Button).ValidationGroup + " is invalid";
            }
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            if (this.IsPostBack)
            {
                if (this.Page.IsValid)
                    this.lblStatus.Text = (sender as Button).ValidationGroup + " is valid";
                else
                    this.lblStatus.Text = (sender as Button).ValidationGroup + " is invalid";
            }
        }
    }
}